<template>
  <el-config-provider :locale="appStore.locale" :size="size">
    <router-view />
    <!-- end chatgpt -->
    <Chatgpt />
  </el-config-provider>
</template>

<script setup lang="ts">
import useSettingsStore from '@/store/modules/settings'
import { handleThemeStyle } from '@/utils/theme'
import useAppStore from '@/store/modules/app'
import { getToken } from '@/utils/auth'
import Chatgpt from './components/chatgpt.vue'

const appStore = useAppStore()
const size = computed(() => appStore.size as any)

onMounted(() => {
  if (getToken()) {
    ElNotification({
      type: 'success',
      dangerouslyUseHTMLString: true,
      message: '<img style="width: 120px;height: 20px" src="https://iita-factory.oss-cn-shanghai.aliyuncs.com/public/openiita.png" alt=""><div>欢迎使用IITA平台</div>',
    })
  }
  nextTick(() => {
    // 初始化主题样式
    handleThemeStyle(useSettingsStore().theme)
  })
})
</script>

<style lang="scss">
.el-table__body-wrapper .el-table-column--selection>.cell {
  display: block;
}
</style>
